package com.atguigu.ssyx.acl.service;

import com.atguigu.ssyx.model.acl.Permission;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author suchengchen
 * @date 2023/9/5
 * @description
 */
public interface PermissionService extends IService<Permission> {

    /**
     * 查询所有菜单
     *
     * @return
     */
    List<Permission> queryAllPermission();

    /**
     * 递归删除菜单
     *
     * @param id
     */
    void removeChildById(Long id);

    /**
     * 根据用户id获取菜单权限
     *
     * @param roleId 用户id
     * @return
     */
    List<Permission> getPermissionByRoleId(Long roleId);

    /**
     * 为用户分配菜单权限
     *
     * @param roleId       用户id
     * @param permissionId
     */
    void doAssign(Long roleId, List<Long> permissionId);
}
